﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Search
{
    class TSearch
    {
        UTLDB.UTLDB _cn = new UTLDB.UTLDB();
        public DataTable SelectSearch(int i, string Name)
        {
            DataTable data;
            if(i==0)
            data= _cn.GetDataByStoredProcedure("sp_SearchMember_UserName",
                new string[] { "@UserName"},
                new object[] { Name});
            else
                data = _cn.GetDataByStoredProcedure("sp_SearchMember_Name",
               new string[] { "@FullName" },
               new object[] { Name });
            return data;
        }
        public DataTable SelectSearchProduct(string Name)
        {
            DataTable data;
                data = _cn.GetDataByStoredProcedure("sp_SearchProduct",
                    new string[] { "@Barcode" },
                    new object[] { Name });
            return data;
        }
    }
}
